package com.pf.责任链模式.spring.demo1;

import lombok.extern.slf4j.Slf4j;
import org.springframework.core.Ordered;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class GroupLeader implements Leader, Ordered {

    @Override
    public boolean handleRequest(LeaveRequest leaveRequest) {
        log.info("请假人：{}请{}天假，由小组长审批...", leaveRequest.getLeaveName(), leaveRequest.getLeaveDays());
        if (leaveRequest.getLeaveDays() > 3) {
            return true;
        }
        return false;
    }

    @Override
    public int getOrder() {
        return 1;
    }
}
